package com.ruoyi.testDeal.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.testDeal.domain.basic.ReportBasicinfo;
import com.ruoyi.testDeal.mapper.ReportBasicinfoMapper;
import com.ruoyi.testDeal.service.IReportBasicinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 报告基本参数信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-29
 */
@Service
public class ReportBasicinfoServiceImpl implements IReportBasicinfoService
{
    @Autowired
    private ReportBasicinfoMapper reportBasicinfoMapper;

    /**
     * 查询报告基本参数信息
     * 
     * @param reportBasicId 报告基本参数信息主键
     * @return 报告基本参数信息
     */
    @Override
    public ReportBasicinfo selectReportBasicinfoByReportBasicId(Long reportBasicId)
    {
        return reportBasicinfoMapper.selectReportBasicinfoByReportBasicId(reportBasicId);
    }

    /**
     * 根据报告编号获取报告基本信息
     *
     * @param reportNum
     */
    @Override
    public ReportBasicinfo selectReportBasicinfoByReportNum(String reportNum) {
        return reportBasicinfoMapper.selectReportBasicinfoByReportNum(reportNum);
    }

    /**
     * 查询报告基本参数信息列表
     * 
     * @param reportBasicinfo 报告基本参数信息
     * @return 报告基本参数信息
     */
    @Override
    public List<ReportBasicinfo> selectReportBasicinfoList(ReportBasicinfo reportBasicinfo)
    {
        return reportBasicinfoMapper.selectReportBasicinfoList(reportBasicinfo);
    }

    /**
     * 新增报告基本参数信息
     * 
     * @param reportBasicinfo 报告基本参数信息
     * @return 结果
     */
    @Override
    public int insertReportBasicinfo(ReportBasicinfo reportBasicinfo)
    {
        reportBasicinfo.setCreateTime(DateUtils.getNowDate());
        return reportBasicinfoMapper.insertReportBasicinfo(reportBasicinfo);
    }

    /**
     * 修改报告基本参数信息
     * 
     * @param reportBasicinfo 报告基本参数信息
     * @return 结果
     */
    @Override
    public int updateReportBasicinfo(ReportBasicinfo reportBasicinfo)
    {
        reportBasicinfo.setUpdateTime(DateUtils.getNowDate());
        return reportBasicinfoMapper.updateReportBasicinfo(reportBasicinfo);
    }

    /**
     * 批量删除报告基本参数信息
     * 
     * @param reportBasicIds 需要删除的报告基本参数信息主键
     * @return 结果
     */
    @Override
    public int deleteReportBasicinfoByReportBasicIds(Long[] reportBasicIds)
    {
        return reportBasicinfoMapper.deleteReportBasicinfoByReportBasicIds(reportBasicIds);
    }

    /**
     * 删除报告基本参数信息信息
     * 
     * @param reportBasicId 报告基本参数信息主键
     * @return 结果
     */
    @Override
    public int deleteReportBasicinfoByReportBasicId(Long reportBasicId)
    {
        return reportBasicinfoMapper.deleteReportBasicinfoByReportBasicId(reportBasicId);
    }

    /**
     * 删除报告基本参数信息
     *
     * @param reportNum
     * @return 结果
     */
    @Override
    public int deleteReportBasicinfoByReportNum(String reportNum) {
        return reportBasicinfoMapper.deleteReportBasicinfoByReportNum(reportNum);
    }
}
